Ext.define('IAG.model.SettingsInstance', {
    extend: 'Ext.data.Model',
    idProperty: 'id',
    fields: [{name:'id',type:'int', defaultValue: -1}, 
             "refreshType", 'howOften','time',
             {name:"dayOfWeek",type:"int"},
             {name:"dayOfMonth",type:"int"},
             {name:"hour",type:"int"},{name:"minute",type:"int"},
             {name:"enabled",type:"boolean", defaultValue: false}
             ],
  
    proxy: {
        type: 'rest',
        api: {
        	create: iag_constants.settingsInstance_url,
            read:  iag_constants.settings_url,
            update: iag_constants.settingsInstance_url,
            destroy: iag_constants.settingsInstance_url
        },
        reader: {
            type: 'json',
            root: 'Settings.SettingsInstance',
            successProperty: 'SettingsInstance'
        },
        writer: {
            type: 'json',
            root: 'SettingsInstance'
        }
    }
});